﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VntNet.PowerSchemeSwitcher
{
    internal class AppContext:ApplicationContext
    {
        SystemTryIcon _systemTryIcon;
        PowerNotificationForm _pwrForm;

        public AppContext()
        {
            _pwrForm = new PowerNotificationForm();
            _systemTryIcon = new SystemTryIcon();
            _systemTryIcon.Show();
            _pwrForm.PowerStatusChangedEvent += new Action<string, PowerSettingNotificationMsgFilter.PowerSavingLevelEnum>(_pwrForm_PowerStatusChangedEvent);
            _pwrForm.Show();
        }

        void _pwrForm_PowerStatusChangedEvent(string currentLineName, PowerSettingNotificationMsgFilter.PowerSavingLevelEnum currentPowerSavingLevel)
        {
            _systemTryIcon.UpdateShownInfo(currentLineName, currentPowerSavingLevel);
        }


    }
}
